#ifndef __MP_HTTP_BASE_H__
#define __MP_HTTP_BASE_H__

#include <iostream>
#include <string>
#include <vector>
#include "http_parser.h"
#include "net_packet.h"

#define HTTP_VERION "HTTP/1.1"

namespace Gazella {

typedef std::pair<std::string, std::string> pair_value;

class HttpBase: public NetPacket {
public:
    HttpBase();
    virtual ~HttpBase();

    //set functions
    void set_version     (const std::string& version);
    void set_method      (const std::string& method);
    void set_status      (const std::string& status);
    void set_status_code (int status_code); 
    void set_uri         (const std::string& uri);
    void set_request_arg (const pair_value& request_arg);
    void set_header      (const pair_value& header);
    void set_body        (const std::string& body);

    //get functions
    const std::string              get_version() const;
    const std::string              get_method() const;
    const std::string              get_status() const;
    const int                      get_status_code() const;
    const std::string              get_uri() const;
    const std::string              get_request_arg(std::string key) const;
    const std::vector<pair_value>& get_request_args() const;
    const std::string              get_header(std::string field) const;
    const std::vector<pair_value>& get_headers() const;
    const std::string              get_body() const;

private:
    int m_status_code;
    std::string m_version = "HTTP/1.1";
    std::string m_method;
    std::string m_status;
    std::string m_uri;
    std::vector<pair_value> m_request_args;
    std::vector<pair_value> m_headers;
    std::string m_body;
};
}

#endif